home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / addres / setup.frm < prev    next >
Text File  |  1995-05-08  |  4KB  |  114 lines

  1. VERSION 2.00
  2. Begin Form Setup 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Port SetUp"
  6.    ClientHeight    =   1740
  7.    ClientLeft      =   3495
  8.    ClientTop       =   3090
  9.    ClientWidth     =   1935
  10.    Height          =   2145
  11.    Left            =   3435
  12.    LinkTopic       =   "Form2"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   1740
  16.    ScaleWidth      =   1935
  17.    Top             =   2745
  18.    Width           =   2055
  19.    Begin SSCommand Command3D1 
  20.       BevelWidth      =   4
  21.       Caption         =   "&Ok"
  22.       Font3D          =   3  'Inset w/light shading
  23.       FontBold        =   -1  'True
  24.       FontItalic      =   0   'False
  25.       FontName        =   "Arial"
  26.       FontSize        =   9.75
  27.       FontStrikethru  =   0   'False
  28.       FontUnderline   =   0   'False
  29.       Height          =   375
  30.       Left            =   480
  31.       TabIndex        =   3
  32.       Top             =   1320
  33.       Width           =   975
  34.    End
  35.    Begin SSFrame Frame3D1 
  36.       Caption         =   "Comm Port:"
  37.       Font3D          =   3  'Inset w/light shading
  38.       FontBold        =   -1  'True
  39.       FontItalic      =   0   'False
  40.       FontName        =   "Arial"
  41.       FontSize        =   8.25
  42.       FontStrikethru  =   0   'False
  43.       FontUnderline   =   0   'False
  44.       Height          =   1095
  45.       Left            =   240
  46.       ShadowColor     =   1  'Black
  47.       ShadowStyle     =   1  'Raised
  48.       TabIndex        =   0
  49.       Top             =   120
  50.       Width           =   1455
  51.       Begin SSOption Option3D2 
  52.          Caption         =   "COM2:"
  53.          Font3D          =   3  'Inset w/light shading
  54.          FontBold        =   -1  'True
  55.          FontItalic      =   0   'False
  56.          FontName        =   "Arial"
  57.          FontSize        =   8.25
  58.          FontStrikethru  =   0   'False
  59.          FontUnderline   =   0   'False
  60.          Height          =   255
  61.          Left            =   240
  62.          TabIndex        =   2
  63.          Top             =   600
  64.          Width           =   975
  65.       End
  66.       Begin SSOption Option3D1 
  67.          Caption         =   "COM1:"
  68.          Font3D          =   3  'Inset w/light shading
  69.          FontBold        =   -1  'True
  70.          FontItalic      =   0   'False
  71.          FontName        =   "Arial"
  72.          FontSize        =   8.25
  73.          FontStrikethru  =   0   'False
  74.          FontUnderline   =   0   'False
  75.          Height          =   255
  76.          Left            =   240
  77.          TabIndex        =   1
  78.          Top             =   360
  79.          Width           =   975
  80.       End
  81.    End
  82. End
  83. Sub Command3D1_Click ()
  84. 'save settings to ini file
  85. ThePort$ = ""
  86. If Option3D1.Value Then
  87.     ThePort$ = "1"
  88. ElseIf Option3D2.Value Then
  89.     ThePort$ = "2"
  90. End If
  91. If ThePort$ = "" Then
  92.     Unload Setup
  93.     Exit Sub
  94. End If
  95. INIFile$ = ThePath & "ADDRESS.INI"
  96. y% = WritePPKeyString%("Phone", "Port", ThePort$, INIFile$)
  97. Unload Setup
  98. End Sub
  99.  
  100. Sub Form_Load ()
  101. 'check ini file for previous settings
  102. Setup.Top = Address.Top + (Address.Height - Setup.Height) \ 3
  103. Setup.Left = Address.Left + (Address.Width - Setup.Width) \ 2
  104. Default$ = "NOPORT"
  105. INIFile$ = ThePath & "Address.ini"
  106. ThePort$ = GetPPKeyString$("Phone", "Port", Default$, INIFile$)
  107. If ThePort$ = "1" Then
  108.     Option3D1.Value = True
  109. ElseIf ThePort$ = "2" Then
  110.     Option3D2.Value = True
  111. End If
  112. End Sub
  113.  
  114.